package com.tbit.uqbike.object.pojo;

import com.tbit.uqbike.constant.UserConstant;

import java.util.Date;

/**
 * 电池方案
 *
 * @author Leon
 * 2017年7月18日 下午7:38:24
 */
public class BatteryModel {
    /**
     * 电池方案id
     */
    private Integer batteryModelId;
    /**
     * 代理商id
     */
    private Integer accountId;
    /**
     * 电池类型(0：根据电压判断；1：根据电量判断 bms;2:根据氢电池判断)
     */
    private Integer batteryType;
    /**
     * 电池方案类型(0：品牌定义；1：代理商自定义)
     */
    private Integer type;
    /**
     * 电池方案名称
     */
    private String name;
    /**
     * 添加时间
     */
    private Date addTime;
    /**
     * 最大续航里程（bms用）
     */
    private Integer maxMileage;
    /**
     * 备注
     */
    private String remark;

    /**
     * 添加人
     */
    private String createBy;

    public Integer getBatteryModelId() {
        return batteryModelId;
    }

    public void setBatteryModelId(Integer batteryModelId) {
        this.batteryModelId = batteryModelId;
    }

    public Integer getAccountId() {
        return accountId;
    }

    public void setAccountId(Integer accountId) {
        this.accountId = accountId;
    }

    public Integer getBatteryType() {
        return batteryType;
    }

    public void setBatteryType(Integer batteryType) {
        this.batteryType = batteryType;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Date getAddTime() {
        return addTime;
    }

    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }

    public Integer getMaxMileage() {
        return maxMileage;
    }

    public void setMaxMileage(Integer maxMileage) {
        this.maxMileage = maxMileage;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    @Override
    public String toString() {
        return "BatteryModel [batteryModelId=" + batteryModelId + ", accountId=" + accountId + ", batteryType=" + batteryType + ", type=" + type + ", name=" + name + ", addTime=" + addTime + ", remark=" + remark + "]";
    }

    public boolean createByAdmin() {
        return accountId == 1 && type.equals(UserConstant.USER_ADMIN);
    }

    public boolean createByBrand() {
        return accountId > 1 && type.equals(UserConstant.USER_ADMIN);
    }

}
